package com.woniu.p2p.serviceImpl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniu.p2p.mapper.UserMonloansMapper;
import com.woniu.p2p.service.MyborrowHistoryService;
import com.woniu.p2p.vo.MyborrowHistoryVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MyborrowHistoryServiceImpl implements MyborrowHistoryService {

    @Autowired
    UserMonloansMapper userMonloansMapper;

    @Override
    public PageInfo<MyborrowHistoryVo> findAllUserMonloans(Integer id, Integer start) {
        PageHelper.startPage(start,100);
        List<MyborrowHistoryVo> list = userMonloansMapper.findAllUserLoansByUserId(id);
        PageInfo<MyborrowHistoryVo> pageInfo=new PageInfo<>(list);
        return pageInfo;
    }
}
